package com.putong35.common.httprequest.responsecallbacks;

import com.putong35.common.baseactfrag.OnListDataUpdateListener;

import java.util.List;

/**
 * Created by Administrator on 2017/11/17.
 */

public class ListBeanResponseListenerImpl<T> extends ListBeanResponseListener<T> {
    private OnListDataUpdateListener listDataUpdateListener;
    public ListBeanResponseListenerImpl(Class aClass, OnListDataUpdateListener listDataUpdateListener) {
        super(aClass);
        this.listDataUpdateListener = listDataUpdateListener;
    }

    @Override
    public void onFailure(Throwable t, int errorNo, String strMsg) {
        if (listDataUpdateListener != null) {
            listDataUpdateListener.onListDataUpdateFailed(errorNo, strMsg);
        }

    }

    @Override
    public void onSuccess(List<T> beanList) {
        if (listDataUpdateListener != null) {
            listDataUpdateListener.onListDataUpdateSuccess(beanList);
        }
    }
}
